import { getAlertData } from '@/api/table'
const AlertData = {
  state: {
    tableData: {}, // 表数据
    detailData: {} // 详细信息，用于编辑获取数据
  },
  mutations: {
    GETALERTDATA: (state, data) => {
      // state.tableData = {}
      state.tableData = data
    }
  },
  actions: {
    getTableData({ commit, state }, val) {
      return new Promise((resolve, reject) => {
        getAlertData(val).then((res) => {
          commit('GETALERTDATA', res.content)
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    }
  }
}
export default AlertData
